package database.pruebas;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**Clase de prueba para ver que funciona el driver.
 * @author Irene*/
public class ConexionDriver {

	public static void cargaDriver(){
		try{
			Class.forName("org.sqlite.JDBC");
		}catch(ClassNotFoundException e){
			e.printStackTrace();
			System.out.println("Driver no cargado.");
		}
	}
	public static void main(String [] args){
		cargaDriver();
		Connection conn= null;
		try {
			conn = DriverManager.getConnection("jdbc:sqlite:lib/test.db");
			
			System.out.println("ok");
		} catch (SQLException e) {
			e.printStackTrace();
			System.out.println("Error de conexion.");
		}
		if(conn!=null){
			try {
				conn.close();
				System.out.println("ok2");
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
			
	}
}
